﻿<%@ Page Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="MaterialSynchronization.aspx.cs"
    Inherits="Inventory_MaterialSynchronization" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phMain" runat="Server">
    <br />
    <asp:Panel ID="Panel2" runat="server" Height="24px" HorizontalAlign="Right" Width="100%">
        <asp:HyperLink ID="HyperLink1" runat="server" Font-Bold="True" Font-Overline="False"
            ForeColor="HotTrack" NavigateUrl="~/Inventory/MaterialList.aspx">进入SMS-Online物料管理页面 》》</asp:HyperLink>
    </asp:Panel>
    <asp:Panel ID="Panel1" runat="server" Height="24px" HorizontalAlign="Center" Width="100%">
        <h2>
            物料数据同步处理</h2>
    </asp:Panel>
    <fieldset style="margin: 10px 10px 10px 10px; padding: 5px 5px 5px 5px;">
        <legend>SMSOnline物料库中不存在的物料列表：</legend>
        <asp:Label ID="label1" runat="server" Font-Bold="True">处理说明：以下处理直接把下列表中物料添加至SMS物料库中</asp:Label>
        <asp:Panel ID="Panel3" runat="server" Height="24px" HorizontalAlign="Right" Width="100%">
            <asp:LinkButton ID="lbtnProcess_Logistic" Text="【处理选择的物料】" runat="server" OnClick="lbtnProcess_Logistic_Click"></asp:LinkButton>｜
            <asp:LinkButton ID="lbtnProcessAll_Logistic" Text="【处理当前页所有物料】" runat="server" OnClick="lbtnProcessAll_Logistic_Click"></asp:LinkButton>
        </asp:Panel>
        <asp:GridView ID="GridView1" runat="server" Width="98%" AllowPaging="True" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSource1" EmptyDataText='"无相关数据集"' PageSize="20">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkLogistic" runat="server" />
                    </ItemTemplate>
                    <ItemStyle Width="18px" />
                </asp:TemplateField>
                <asp:BoundField DataField="MaterialID" HeaderText="物料编号" SortExpression="MaterialID" />
                <asp:BoundField DataField="MaterialName" HeaderText="物料名称" SortExpression="MaterialName" />
                <asp:BoundField DataField="Spec" HeaderText="规格" SortExpression="Spec" />
                <asp:BoundField DataField="OrderUnit" HeaderText="订货单位" SortExpression="OrderUnit" />
                <asp:BoundField DataField="LogisticCategoryFullName" HeaderText="分类" SortExpression="LogisticCategoryFullName" />
                <asp:BoundField DataField="LogisticStatus" HeaderText="状态" SortExpression="LogisticStatus" />
            </Columns>
            <HeaderStyle BackColor="Gray" />
            <AlternatingRowStyle BackColor="#E0E0E0" />
        </asp:GridView>
    </fieldset>
    <fieldset style="margin: 10px 10px 10px 10px; padding: 5px 5px 5px 5px;">
        <legend>SMSOnline物料库与Logistic物料库不匹配的物料列表：</legend>
        <asp:Label ID="label3" runat="server" Font-Bold="True" ForeColor="red">注意：红色字体代表Logistic库中的值，说明Logistic库与SMS库不匹配的值，同时需要更改。</asp:Label>
        <asp:GridView ID="GridView3" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSource3" EmptyDataText="无数据" Width="98%" PageSize="20">
            <Columns>
                <asp:BoundField DataField="MaterialID" HeaderText="物料编号" SortExpression="MaterialID" />
                <asp:TemplateField HeaderText="物料编号">
                    <ItemTemplate>
                        <asp:Label ID="lblMaterialName_SMS" Text='<%#Eval("MaterialName") %>' runat="server"></asp:Label>
                        <asp:Label ID="lblMaterialName_Logistic" Text='<%#"【"+Eval("Logistic_MaterialName")+"】"%>' ForeColor="red" 
                            Visible='<%# IsVisible(Eval("MaterialName").ToString(),Eval("Logistic_MaterialName").ToString()) %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="基本单位">
                    <ItemTemplate>
                        <asp:Label ID="lblBaseUnit_SMS" Text='<%#Eval("BaseUnit")%>' runat="server"></asp:Label>
                        <asp:Label ID="lblBaseUnit_Logistic" Text='<%#"【"+Eval("Logistic_BaseUnit")+"】"%>' ForeColor="red"
                            Visible='<%# IsVisible(Eval("BaseUnit").ToString(),Eval("Logistic_BaseUnit").ToString()) %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="订货单位">
                    <ItemTemplate>
                        <asp:Label ID="lblOrderUnit_SMS" Text='<%#Eval("OrderUnit") %>' runat="server"></asp:Label>
                        <asp:Label ID="lblOrderUnit_Logistic" Text='<%#"【"+Eval("Logistic_OrderUnit")+"】"%>' ForeColor="red"
                            Visible='<%# IsVisible(Eval("OrderUnit").ToString(),Eval("Logistic_OrderUnit").ToString()) %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="采购单位">
                    <ItemTemplate>
                        <asp:Label ID="lblStockUnit_SMS" Text='<%#Eval("StockUnit") %>' runat="server"></asp:Label>
                        <asp:Label ID="lblStockUnit_Logistic" Text='<%#"【"+Eval("Logistic_StockUnit")+"】"%>' ForeColor="red" 
                            Visible='<%# IsVisible(Eval("StockUnit").ToString(),Eval("Logistic_StockUnit").ToString()) %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="单位转换(基-&gt;订)">
                    <ItemTemplate>
                        <asp:Label ID="lblBUnitConvertOUnitValue_SMS" Text='<%#Eval("BUnitConvertOUnitValue") %>'
                            runat="server"></asp:Label>
                        <asp:Label ID="lblBUnitConvertOUnitValue_Logistic" Text='<%#"【"+Eval("Logistic_BUnitConvertOUnitValue")+"】" %>' ForeColor="red"
                            Visible='<%# IsVisible(Eval("BUnitConvertOUnitValue").ToString(),Eval("Logistic_BUnitConvertOUnitValue").ToString()) %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="单位转换(基-&gt;采)">
                    <ItemTemplate>
                        <asp:Label ID="lblBUnitConvertSUnitValue_SMS" Text='<%#Eval("BUnitConvertSUnitValue") %>'
                            runat="server"></asp:Label>
                        <asp:Label ID="lblBUnitConvertSUnitValuee_Logistic" Text='<%#"【"+Eval("Logistic_BUnitConvertSUnitValue") +"】"%>' ForeColor="red"
                            Visible='<%# IsVisible(Eval("BUnitConvertSUnitValue").ToString(),Eval("Logistic_BUnitConvertSUnitValue").ToString()) %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Logistic状态">
                    <ItemTemplate>
                        <asp:Label ID="lblLogisticStatus_SMS" Text='<%#Eval("LogisticStatus") %>' runat="server"></asp:Label>
                        <asp:Label ID="lblLogisticStatus_Logistic" Text='<%#"【"+Eval("Logistic_LogisticStatus")+"】"%>' ForeColor="red"
                            Visible='<%# IsVisible(Eval("LogisticStatus").ToString(),Eval("Logistic_LogisticStatus").ToString()) %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle BackColor="Gray" />
            <AlternatingRowStyle BackColor="#E0E0E0" />
        </asp:GridView>
    </fieldset>
    <fieldset style="margin: 10px 10px 10px 10px; padding: 5px 5px 5px 5px;">
        <legend>Logistic物料库中不存在的物料列表：</legend>
        <asp:Label ID="label2" runat="server" Font-Bold="True" ForeColor="Red">处理说明：以下处理直接把下列表中物料(SMS库)的状态改为禁用，使之成为不可订货</asp:Label>
        <asp:Panel ID="Panel5" runat="server" Height="24px" HorizontalAlign="Right" Width="100%">
            <asp:LinkButton ID="lbtnProcess_SMS" Text="【处理选择的物料】" runat="server" OnClick="lbtnProcess_SMS_Click"></asp:LinkButton>｜
            <asp:LinkButton ID="lbtnProcessAll_SMS" Text="【处理当前页所有物料】" runat="server" OnClick="lbtnProcessAll_SMS_Click"></asp:LinkButton>
        </asp:Panel>
        <asp:GridView ID="GridView2" runat="server" Width="98%" AllowPaging="True" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSource2" EmptyDataText='"无相关数据集"' PageSize="20">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSMS" runat="server" />
                    </ItemTemplate>
                    <ItemStyle Width="18px" />
                </asp:TemplateField>
                <asp:BoundField DataField="MaterialID" HeaderText="物料编号" SortExpression="MaterialID" />
                <asp:BoundField DataField="MaterialName" HeaderText="物料名称" SortExpression="MaterialName" />
                <asp:BoundField DataField="Spec" HeaderText="规格" SortExpression="Spec" />
                <asp:BoundField DataField="OrderUnit" HeaderText="订货单位" SortExpression="OrderUnit" />
                <asp:BoundField DataField="LogisticCategoryFullName" HeaderText="分类" SortExpression="LogisticCategoryFullName" />
                <asp:BoundField DataField="LogisticStatus" HeaderText="状态" SortExpression="LogisticStatus" />
            </Columns>
            <HeaderStyle BackColor="Gray" />
            <AlternatingRowStyle BackColor="#E0E0E0" />
        </asp:GridView>
    </fieldset>
    <asp:Panel ID="Panel6" runat="server" Height="24px" HorizontalAlign="Right" Width="100%">
        <asp:HyperLink ID="HyperLink2" runat="server" Font-Bold="True" Font-Overline="False"
            ForeColor="HotTrack" NavigateUrl="~/Inventory/MaterialList.aspx">进入SMS-Online物料管理页面 》》</asp:HyperLink>
    </asp:Panel>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetMaterialSynchronizationForLogistic"
        TypeName="Inventory"></asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" SelectMethod="GetMaterialSynchronizationForKey"
        TypeName="Inventory"></asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetMaterialSynchronizationForSMS"
        TypeName="Inventory"></asp:ObjectDataSource>
</asp:Content>
